import Vue from 'vue'
import Router from 'vue-router'

// 导入新建的组件（登录等等）
import AppIndex from '@/components/home/AppIndex'

import Login from '@/components/login'

import Goods from '@/components/home/goods'

import Test from '@/components/home/test'

import Layout from '@/components/layout'

import HomePage from '@/components/HomePage'

import treeMenu from '@/components/treeMenu'

import Tags from '@/components/common/Tags'

import Echarts from '@/components/Echarts'

import Light from '@/components/LightEcharts'

import BarCharts from '@/components/BarCharts'

import HeaderPage from '@/components/HeaderPage'
Vue.use(Router)

export default new Router({
// 该配置用于去除路由中的#
  mode: 'history',
  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // }, 
    {
   path:'/bar',
   name:'barCharts',
   component: BarCharts
    },
    {
      path:'/light',
      name:'Light',
      component: Light
    },
    // {
    //   path:'/charts',
    // name:'myCharts',
    // component: Echarts
    // },
    {
      path:'/tags',
      name:'Tags',
      component: Tags
    } ,
      {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/tree',
      name: 'TreeMenu',
      component: treeMenu
    },
    {
      path: '/',
      redirect: '/header',
    },
    {
      path:'/',
      component: HomePage,
      meta: {title:'正文文件'},
      children:[
        {path:'/header',component: HeaderPage,meta:{title:'首页文件'}},
        {path:'/goods',component: Goods,meta:{title:'货物详细情况'}},
        {path:'/test',component: Test,meta:{title:'系统测试'}},
        {path:'/index',component: AppIndex,meta:{title:'系统转库存首页'}},
        {path:'/charts',component: Echarts,meta:{title:'热力图分布'}}
      ]
    },
  ]
})

//     {
//       path: '/index',
//       name: 'AppIndex',
//       component: AppIndex
//     },
//     {
//       path: '/goods',
//       name: 'Goods',
//       component: Goods
//     },
//     {
//       path: '/test',
//       name: 'Test',
//       component: Test
//     },
//     {
//       path: '/home',
//       name: 'HomePage',
//       component: HomePage
//     }
//   ]
// })